Ext.define('iMedproplus.controller.admin.User', {
    extend: 'iMedproplus.controller.Abstract',
    
    stores: [
    'iMedproplus.store.User'
    ],
    
    views: [
    'admin.user.UserGrid'
    ],
    
    models:[
    'User'
    ],
    
    currentUser : [],
    currentWindow : {},
    passwordWinow : {},
    
    constructor: function(){
        this.callParent(arguments);
        this.abstractConfig = {
            view : this.getAdminUserUserGridView(),
            model : 'iMedproplus.model.User',
            store: this.getIMedproplusStoreUserStore()
        };
        this.control({
            'adminuserusergrid' : {
                userSelectionChange: this.onUserSelectionChange
            }
        });
    },
    
    onUserSelectionChange: function(users){
        if(users!=null){
            if(users.length!=0){
                this.currentUser = users[0].data;
            }
        }
    }
});
